package com.cirkana.viewer.route.gpx;

import java.util.ArrayList;
import java.util.List;

public class Track {

	private String name;
	private String desc;
	private String cmt;
	private List<TrackPoint> trackPoints = new ArrayList<TrackPoint>();

	protected Track() {
	}

	protected Track(String name, String desc, String cmt,
			List<TrackPoint> trackPoints) {
		this.name = name;
		this.desc = desc;
		this.cmt = cmt;
		this.trackPoints = trackPoints;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getCmt() {
		return cmt;
	}

	public void setCmt(String cmt) {
		this.cmt = cmt;
	}

	public List<TrackPoint> getTrackPoints() {
		return trackPoints;
	}

	public void setTrackPoints(List<TrackPoint> trackPoints) {
		this.trackPoints = trackPoints;
	}

	public static Track getTrack() {
		return new Track();
	}

	public static Track getTrack(String name, String desc, String cmt,
			List<TrackPoint> trackPoints) {
		return new Track(name, desc, cmt, trackPoints);
	}

	@Override
	public String toString() {
		StringBuilder s = new StringBuilder();
		s.append("track={name=" + name);
		s.append(",desc=" + desc);
		s.append(",cmt=" + cmt);
		for (int iii = 0; iii < this.trackPoints.size(); iii++)
			s.append("," + this.trackPoints.get(iii).toString());
		s.append("}");
		return s.toString();
	}
}
